import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
	url:'http://localhost:8081',
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/userinfo',
          name: 'userinfo',
          component: () => import('@/views/user/UserInfo.vue'),
          meta: {
            locale: 'menu.dashboard',
            requiresAuth: true,
            icon: 'icon-dashboard',
			roles:['*']
          },
        },
        {
          path: '/data',
          name: 'data',
          component: () => import('@/views/data/index.vue'),
          meta: {
            locale: 'menu.dashboard.monitor',
            requiresAuth: true,
            roles: ['admin'],
          },
        },
        {
          path: '/workbench',
          name: 'workbench',
          component: () => import('@/views/home/WorkBench.vue'),

        },
        {
          path: '/login',
          name: 'login',
          component: () => import('@/views/login/index.vue'),

        }
      ]
    },

  ]
})


export default router
